#ifndef __GENERAL_TIMER_H__
#define	__GENERAL_TIMER_H__

#include <stdint.h>
#include "ucos_ii.h"
#include <stdio.h>

typedef struct timer {
    uint32_t interval;
    uint32_t leave;
    uint8_t timeout_flg;
    uint8_t repeat_flg;
}timer_t;


typedef struct etimer {
    timer_t timer;
    struct etimer *next;
} etimer_t;

#define     MAX_ETIMER_CNTS      10

void sleep(uint16_t sec);
void msleep(uint16_t ms);

void App_TimeTickHook();

void etimer_init();
void etimer_add(etimer_t *etimer, uint32_t interval, uint8_t repeate);
uint8_t etimer_check(etimer_t *etimer);

#endif
